/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.rpc.xuelang.constants.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 雪浪文件类型
 *
 * @author hxloongs
 * @date 2025-2-14
 */
@AllArgsConstructor
@Getter
public enum XueLangResponseCodeEnum {
    SUCCESS(200, "成功");
    private final Integer value;
    private final String desc;

    public static String getDescByValue(Integer value) {
        XueLangResponseCodeEnum xuelangRenderFileTypeEnum = forValue(value);
        if (xuelangRenderFileTypeEnum == null) {
            return null;
        }
        return xuelangRenderFileTypeEnum.getDesc();
    }

    public static XueLangResponseCodeEnum forValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (XueLangResponseCodeEnum xuelangRenderFileTypeEnum : XueLangResponseCodeEnum.values()) {
            if (xuelangRenderFileTypeEnum.getValue().equals(value)) {
                return xuelangRenderFileTypeEnum;
            }
        }
        return null;
    }

    public static XueLangResponseCodeEnum forDesc(String desc) {
        if (desc == null) {
            return null;
        }
        for (XueLangResponseCodeEnum xuelangRenderFileTypeEnum : XueLangResponseCodeEnum.values()) {
            if (desc.equals(xuelangRenderFileTypeEnum.getDesc())) {
                return xuelangRenderFileTypeEnum;
            }
        }
        return null;
    }
}
